<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <link rel="stylesheet" href="1.css">
</head>
<body>
hello world


<script>
  // 非简单请求：put delete
  // 传递了一个自定义请求头
  // options prefight 预检查
  //
  let xhr = new XMLHttpRequest();
  xhr.open('PUT','http://localhost:3000/userList',true);
  xhr.responseType = 'json';
  document.cookie='token=100';//默认不支持cookie 跨域
  xhr.withCredentials=true;
  xhr.setRequestHeader('token','fsfdsfs.fdsfdsfd.org')
  xhr.onreadystatechange=function () {
      if (xhr.status===200&& xhr.readyState===4){
          console.log(xhr.response);
      }
  }
  xhr.send();
</script>
</body>
</html>
